-- Copyright 2013 ECHO Games
-- This file is a part of Galaga Revolution
-- Galaga Revolution is free software licensed under the GNU General Public License version 3.
-- You may redistribute and/or modify it under the terms of the GNU General Public License
-- version 3 as published by the Free Software Foundation.updater
-- Galaga Revolution comes without a warranty; without even the implied warranty of merchantability
-- or fitness for a particular purpose. See the GNU General Public License version 3 for more
-- details.
-- You should have received the GNU General Public License version 3 with this in GPL.txt
-- if not it is available at <http://www.gnu.org/licenses/gpl.txt>.
-- All resources for Galaga Revolution including: source code, compiled jar, documentation, and source
-- notes are available at: <http://code.google.com/p/echo-gaming-galaga-revolution/>

button = {}

function button_spawn(x,y,text,id)
	table.insert(button, {x = x,y = y, text = text, id = id})
end
function button_draw()
	for i,v in ipairs(button) do
	if v.mouseover == false then
		love.graphics.setColor(255,255,255)
	end
	if v.mouseover == true then
		love.graphics.setColor(0,255,255)
	end
		love.graphics.setFont(medium)
		love.graphics.print(v.text,v.x,v.y)
	end
end
function picture_draw()
	picture = love.graphics.newImage("galagarevolution.fw.png")
	love.graphics.draw(picture,25,5)
end
function button_click(x,y)
	for i,v in ipairs(button) do
		if x > v.x and
			x < v.x + medium:getWidth(v.text) and
			y > v.y and
			y < v.y + medium:getHeight() then
		if v.id == "quit" then
			love.event.push("quit")
		end
		if v.id == "start" then
			gamestate = "playing"
		end
		end
	end
end
function button_check()
	for i,v in ipairs(button) do
		if mousex > v.x and
			mousex < v.x + medium:getWidth(v.text) and
			mousey > v.y and
			mousey < v.y + medium:getHeight() then
			v.mouseover = true
		else
			v.mouseover = false
		end
	end
end